<?php

function connectToDB() {
    $hostdb = 'contactsmanager.db.8573195.hostedresource.com'; // MySQl host
    $userdb = 'contactsmanager';  
    $passdb = 'CYmox1@';  
    $namedb = 'contactsmanager';
    $link = mysql_connect($hostdb, $userdb, $passdb);

    if (!$link) {
        die('Could not connect: ' . mysql_error());
    }
    $db_selected = mysql_select_db($namedb);
    if (!$db_selected) {
        die('Can\'t use database : ' . mysql_error());
    }
    return $link;
}
?>